﻿namespace WeiboPlus.Models
{    
    public class ImageResolution
    {
        public ImageResolution()
        {
 
        }

        public ImageResolution(int h, int w, int q)
        {
            _height = h;
            _width = w;
            _quality = q;
        }

        int _height;
        public int Height
        {
            get
            {
                return _height;
            }
            set
            {
                _height = value;
            }
        }

        int _width;
        public int Width
        {
            get
            {
                return _width;
            }
            set
            {
                _width = value;
            }
        }

        int _quality;
        public int Quality
        {
            get
            {
                return _quality;
            }
            set
            {
                _quality = value;
            }
        }

        public override bool Equals(object obj)
        {
            var o = obj as ImageResolution;
            if (o == null)
                return false;

            return true
                && _width == o._width
                && _height == o._height
                && _quality == o._quality;
        }

        public override string ToString()
        {
            var s = string.Format("{0} * {1} * {2}", _width, _height, _quality);

            return s;
        }

        public override int GetHashCode()
        {
            return ToString().GetHashCode();
        }
    }
}
